package com.car.loan.project.xr.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Collection;
import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.car.loan.project.xr.mapper.LoanDetailMapper;
import com.car.loan.project.xr.domain.LoanDetail;
import com.car.loan.project.xr.service.ILoanDetailService;

/**
 * 业务详细资料、录入资料Service业务层处理
 *
 * @author ruoyi
 * @date 2019-11-03
 */
@Service
public class LoanDetailServiceImpl implements ILoanDetailService {

    @Autowired
    private LoanDetailMapper loanDetailMapper;

    /**
     * 查询业务详细资料、录入资料
     *
     * @param id 业务详细资料、录入资料ID
     * @return 业务详细资料、录入资料
     */
    @Override
    public LoanDetail selectLoanDetailById(Long id) {
        return loanDetailMapper.selectById(id);
    }

    /**
     * 查询业务详细资料、录入资料列表
     *
     * @param loanDetail 业务详细资料、录入资料
     * @return 业务详细资料、录入资料
     */
    @Override
    public List<LoanDetail> selectLoanDetailList(LoanDetail loanDetail) {
        QueryWrapper<LoanDetail> queryWrapper = new QueryWrapper<>(loanDetail);
        return loanDetailMapper.selectList(queryWrapper);
    }


    @Override
    public IPage<LoanDetail> selectPage(IPage<LoanDetail> page,
        QueryWrapper<LoanDetail> queryWrapper) {
        return loanDetailMapper.selectPage(page, queryWrapper);
    }

    /**
     * 新增业务详细资料、录入资料
     *
     * @param loanDetail 业务详细资料、录入资料
     * @return 结果
     */
    @Override
    public int insertLoanDetail(LoanDetail loanDetail) {

        return loanDetailMapper.insert(loanDetail);
    }

    /**
     * 修改业务详细资料、录入资料
     *
     * @param loanDetail 业务详细资料、录入资料
     * @return 结果
     */
    @Override
    public int updateLoanDetail(LoanDetail loanDetail) {

        return loanDetailMapper.updateById(loanDetail);
    }

    /**
     * 删除业务详细资料、录入资料对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLoanDetailByIds(Collection<Long> ids) {
        return loanDetailMapper.deleteBatchIds(ids);
    }

    /**
     * 删除业务详细资料、录入资料信息
     *
     * @param id 业务详细资料、录入资料ID
     * @return 结果
     */
    @Override
    public int deleteLoanDetailById(Long id) {
        return loanDetailMapper.deleteById(id);
    }
}
